<? include("acceso.php");?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Admin</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
		<link href="css/bootstrap.css" rel="stylesheet">
		<link href="css/bootstrap-responsive.css" rel="stylesheet">
		<link href="css/adm.css" rel="stylesheet">
		<!--[if lt IE 9]><script type="text/javascript" src="js/html5.js"></script><![endif]-->
		<!--<script src="js/bootstrap.js"></script>-->
		
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js" ></script>
<script type="text/javascript">





tinyMCE.init({



        mode : "textareas",



        theme : "advanced",
plugins : "imgsurfer",
        theme_advanced_buttons4 : "imgsurfer",





});



function MM_effectBlind(targetElement, duration, from, to, toggle)



{



	Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});



}





</script>

</head>

<body>
<?php 
if($loginCorrecto) 
{ ?>

<div class="container-fluid" >


<?
$grabar= $_POST["grabar"];
			if(empty($grabar)){ 
			
			$dat= $_GET["act"]; 
//include'clsJovAdm.php';
	//$objContenido = new contenido;
	
	$sqlDatos = $objContenido -> libro_det($dat);
	
	
	$campo=mysql_fetch_assoc($sqlDatos);
	
	$Titulo=$campo['titulo'];
	$Url=$campo['tituloc'];
	
	$Titulo = str_replace("<p>","",$Titulo); 
$Titulo = str_replace("</p>","",$Titulo); 
	
	//$dato1=$campo['nombrem'];?>
<form action="act_lib.php" method="post"  name="form1"  onSubmit="return enviar_formulario();">
                        
                        
                        
						
							  <input   type="hidden"  name="txtid"  value="<? echo $campo['id_recurso'];?>" />
								
							
<br><br><br>
								
									<span class='text-info'><strong> Titulo :</strong></span><br>
								<input type="text" name="titulo" id="textfield" class="Titul"  value="<?   echo utf8_encode($Titulo);?>" />
								
							
                              <br> <br>  
                            <span class='text-info'><strong>   Url :</strong></span><br>
								
								
          <input type="text" name="titurl" id="textfield" class="Titul"  value="<?   echo $Url;?>" />
                               
<br>  
                                
                                 
								
						
						<div class="spacer-20">
							&#32;
						</div>
					<br>
                    
                    <input name="grabar" type="submit"   class="btn btn-primary " value="Actualizar" />

						
				
			</form>
            
            <? }
            else {
	

$tit = "<p>".$_POST['titulo']."</p>";

$tit = str_replace("ó","&#243;",$tit);
$tit = str_replace("á","&#225;",$tit);
$tit = str_replace("é","&#233;",$tit);
$tit = str_replace("í","&#237;",$tit);
$tit = str_replace("ú","&#250;",$tit);
$tit = str_replace("ñ","&#241;",$tit);
$tit = str_replace("¿","&iquest;",$tit);
$tit = str_replace('"',"&#34;",$tit);
$tit = str_replace('?',"&#63;",$tit);
$tit = str_replace('(',"&#40;",$tit);
$tit = str_replace(')',"&#41;",$tit);

$urll = $_POST['titurl'];
$actual = $objContenido -> Act_lib($tit,$urll,$_POST['txtid']);  
echo '<script>alert("Datos fueron actualizados.");window.opener.location.reload();window.close();
	
	 </script>';
			}
			
			?>
            
	</div>
     <?
} 
else

{?>
<div align="center">
<h3>Usuario no permitido</h3>
<p>
	<a href="login.php">Inicio</a>
</p>
<?
}
?>

</body>
</html>
